package com.example.ida;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.GridView;
import android.widget.ImageView;

public class ImageAdapter extends BaseAdapter{
	
	private Context mContext;
	private Integer[] mThumbIds= {
			R.drawable.loading,
			R.drawable.ida_b,
			R.drawable.ic_launcher
	};
	
	public ImageAdapter(Context c){
		mContext = c; 
	}
	
	public int getCount(){
		return mThumbIds.length; 
	}
	
	public Object getItem(int position) {
		return null;
	}
	
	public long getItemId(int position){
		return 0;
	}
	
	public View getView(int position, View convertView, ViewGroup parent){
		ImageView imageView;        
		  if (convertView == null) {              
		   imageView = new ImageView(mContext);            
		   imageView.setLayoutParams(new GridView.LayoutParams(200, 200));            
		   imageView.setScaleType(ImageView.ScaleType.FIT_CENTER);            
		   imageView.setPadding(20, 20, 20, 20);        
		     } else {            
		   imageView = (ImageView) convertView;        
		  }
		  imageView.setImageResource(mThumbIds[position]);        
		  return imageView;    
	}
}
